using System;

namespace umbracoRss.BusinessLogic
{
	/// <summary>
	/// Summary description for rssHandler.
	/// </summary>
	public class rssHandler : umbraco.BusinessLogic.Actions.IActionHandler
	{
		public rssHandler()
		{
		}
		#region IActionHandler Members

		public string HandlerName()
		{
			return "umbracoRss feed generator";
		}

		public bool Execute(umbraco.cms.businesslogic.web.Document documentObject, umbraco.interfaces.IAction action)
		{
			// TODO:  Add rssHandler.Execute implementation
			return BusinessLogic.Generator.GenerateFromPath(documentObject.Parent.Id, documentObject.Path, documentObject);
		}

		public umbraco.interfaces.IAction[] ReturnActions()
		{
#if v3
            umbraco.interfaces.IAction[] retval = { new umbraco.BusinessLogic.Actions.ActionPublish() }; 
#endif
#if v4
            umbraco.interfaces.IAction[] retval = { umbraco.BusinessLogic.Actions.ActionPublish.Instance }; 
#endif
			return retval;
		}

		#endregion
	}
}
